package com.bw.controller;

import com.bw.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/***************************
 FileAction:

 CreateTime:2022-07-28 13:36
 Author:Aaking-aline
 ****************************/
@Controller
public class GoodsController {

	@Autowired
	private GoodsService goodsService;

	@RequestMapping("getGoods")
	@ResponseBody   // 这个注解一加 表示返回值是数据 而不是 跳转地址
	public String getGoods(){
		return goodsService.selectAllGoods();
	}

	@RequestMapping("getOrder")
	@ResponseBody
	public String getGoodsOrderBy(){
		return goodsService.selectGoodsOrderByPrice();
	}

	@RequestMapping("getLimit")
	@ResponseBody
	public String getGoodsLimit(String page){

		System.out.println(page);

		return goodsService.selectGoodsLimit(page,"5");
	}


}
